package com.ruoyi.ai.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * 变更类型
 */
@AllArgsConstructor
@Getter
public enum ChangeTypeEnum {
    USER_ADD(0,"用户购买"),
    USER_CONSUME(1,"用户消耗"),
    ADMIN_ADD(2,"后台增加"),
    ADMIN_REDUCE(3,"后台扣减"),
    REGISTER_GIVE(4,"注册赠送"),
    AD_GIVE(5,"广告赠送"),
    ;
    private Integer type;
    private String desc;

    public static ChangeTypeEnum getByType(Integer type){
        return Arrays.stream(values()).filter(c-> c.getType().equals(type)).findFirst().orElse(null);
    }

}
